<div class="comments">

<?php if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) { die ('Please do not load this page directly. Thanks!'); } if (!empty($post->post_password)) { if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { ?>
	<p class="nopassword"><?php _e('This post is password protected. Enter the password to proceed.', 'braille') ?></p>
<?php return; } } ?>

<?php if ( $comments ) : ?>

<?php
$ping_count = $comment_count = 0;
foreach ( $comments as $comment )
	get_comment_type() == "comment" ? ++$comment_count : ++$ping_count;
?>

<?php if ( $comment_count ) : ?>

	<h3 class="comment-header" id="numcomments"><?php echo wptexturize(sprintf(__('%1$s %2$s to "%3$s"', 'braille'), get_comments_number(), (1 == $post->comment_count) ? __('Comment', 'braille'): __('Comments', 'braille'), wp_specialchars(get_the_title(),1) )); ?></h3>
	<ol id="comments" class="commentlist">
<?php foreach ($comments as $comment) : ?>
<?php if ( get_comment_type() == "comment" ) : ?>

		<li id="comment-<?php comment_ID() ?>" class="<?php braille_comment_class() ?>">
			<div class="comment-info">
				<strong class="comment-author">
					<?php if ( function_exists('comment_favicon') ) { comment_favicon(); } ?>
					<?php if ( function_exists('gravatar') ) { ?>
					<div class="gravatar">
						<img src="<?php gravatar("G", 32, get_bloginfo('template_url')."/images/gravatar.gif"); ?>" width="32" height="32" alt="Gravatar" />
					</div>
					<?php } ?>
					<?php comment_author_link() ?> said...
				</strong><br />
				<small class="comment-meta"><?php comment_date(); ?></small>
			</div>
			<div class="comment-content">
				<?php comment_text() ?>
			</div>
			<div class="clear"></div>
		</li>

<?php endif; ?>
<?php endforeach; ?>

	</ol>

<?php endif; ?>

<?php if ( $ping_count ) : ?>

	<h3 class="comment-header" id="numpingbacks"><?php _e('Trackbacks &amp; Pingbacks', 'braille'); ?></h3>
	<ol id="pingbacks" class="commentlist">

<?php foreach ( $comments as $comment ) : ?>
<?php if ( get_comment_type() != "comment" ) : ?>

		<li id="comment-<?php comment_ID() ?>" class="<?php braille_comment_class() ?>">
			<p>
				<span class="comment-author">
					<?php if ( function_exists('comment_favicon') ) { comment_favicon(); } ?>
					<span><?php comment_author_link(); ?></span>
				</span><br />
				<small class="comment-metadata">
					<?php printf(__('%1$s on %2$s', 'braille'), '<span class="type">' . get_braille_ping_type(__('Trackback', 'braille'), __('Pingback', 'braille')) . '</span>', sprintf(__('%1$s at %2$s', 'braille'), get_comment_date(__('F jS, Y','braille')), get_comment_time())); ?>
				</small>
			</p>
			<div class="clear"></div>
		</li>

<?php endif; ?>

<?php endforeach; ?>

	</ol>

<?php endif; ?>
<?php endif; ?>

<?php if ( 'open' == $post->comment_status ) : ?>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
	<div id="mustlogin"><?php printf(__('You must be <a href="%s" title="Log in">logged in</a> to post a comment.', 'braille'),
			get_option('siteurl') . '/wp-login.php?redirect_to=' . get_permalink() ) ?></div>

<?php else : ?>

	<div class="formcontainer">

		<form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">

<?php if ($user_ID) { ?>

			<small id="loggedin"><?php printf(__('Logged in as <a href="%1$s" title="Logged in as %2$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'braille'), get_option('siteurl') . '/wp-admin/profile.php', wp_specialchars($user_identity, true), get_option('siteurl') . '/wp-login.php?action=logout&amp;redirect_to=' . get_permalink() ) ?></small>
			
<?php } else { ?>
		
			<p><input id="author" name="author" type="text" value="<?php echo $comment_author ?>" size="30" maxlength="20" tabindex="3" /><label for="author"><?php _e('Name', 'braille') ?></label> <?php if ($req) echo '<span class="required">*</span>'; ?></p>

			<p><input id="email" name="email" type="text" value="<?php echo $comment_author_email ?>" size="30" maxlength="50" tabindex="4" /><label for="email"><?php _e('Email', 'braille') ?></label> <?php if ($req) echo '<span class="required">*</span>'; ?></p>

			<p><input id="url" name="url" type="text" value="<?php echo $comment_author_url ?>" size="30" maxlength="50" tabindex="5" /><label for="url"><?php _e('Website', 'braille') ?></label></p>
			
<?php } ?>

			<p class="form-textarea"><textarea id="comment" name="comment" cols="45" tabindex="6"></textarea></p>
			
			<?php if ( function_exists('show_subscription_checkbox') ) { show_subscription_checkbox(); } ?>
			
			<p class="submit"><input id="submit" name="submit" type="submit" value="<?php _e('Post Comment', 'braille') ?>" tabindex="7" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p>
			
			<div class="clear"></div>

<?php do_action('comment_form', $post->ID); ?>

		</form>
	</div>

<?php endif; ?>
<?php endif; ?>

</div>